#include "main/utils.h"
using namespace std;

void combineNKCore(const int& n, const int& k, int index, vector<int>& cur_subset, vector<vector<int>>& result) {
  if (cur_subset.size() == k) {
    result.push_back(cur_subset);
    return;
  }
  if (index < 1 || index > n) {
    return;
  }
  combineNKCore(n, k, index + 1, cur_subset, result);
  cur_subset.push_back(index);
  combineNKCore(n, k, index + 1, cur_subset, result);
  cur_subset.pop_back();
}

vector<vector<int>> combineNK(const int& n, const int& k) {
  vector<vector<int>> ret;
  vector<int> cur_subset;
  combineNKCore(n, k, 1, cur_subset, ret);
  return ret;
}

int main() {
  int n = 3, k = 2;
  auto ret = combineNK(n, k);
  printVec("o80", ret);

  return 0;
}
